package com.quan.mall.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.quan.common.base.bean.PageBean;
import com.quan.common.biz.support.BaseService;
import com.quan.mall.entity.MallGoodsSpecAttr;
import com.quan.mall.mapper.MallGoodsSpecAttrMapper;
import com.quan.mall.service.MallGoodsSpecAttrService;

/**
 * <p>
 * 电商-商品规格属性表 服务实现类
 * </p>
 *
 * @author 杨浩泉
 * @since 2018-10-25
 */
@Service
public class MallGoodsSpecAttrServiceImpl extends BaseService<MallGoodsSpecAttr> implements MallGoodsSpecAttrService {

	@Autowired
	private MallGoodsSpecAttrMapper mapper ;
	
	@Override
	public List<MallGoodsSpecAttr> selectSpecAttrAndValueByCategoryId(Long categoryId) {
		return this.mapper.selectSpecAttrAndValueByCategoryId(categoryId);
	}
	
	@Override
	public List<MallGoodsSpecAttr> selectSpecAttrAndValueByBrandId(Long brandId) {
		return this.mapper.selectSpecAttrAndValueByBrandId(brandId);
	}
	
	@Override
	public List<MallGoodsSpecAttr> selectSpecAttrAndValueByTypeId(Long typeId) {
		return this.mapper.selectSpecAttrAndValueByTypeId(typeId);
	}

	@Override
	public PageInfo<MallGoodsSpecAttr> selectPageAssociationCategoryAndBrandAndType(MallGoodsSpecAttr entity, PageBean pageBean) {
		
		Page<MallGoodsSpecAttr> page = PageHelper.startPage(pageBean.getPage(), pageBean.getLimit());

		this.mapper.selectPageAssociationCategoryAndBrandAndType(entity, pageBean) ;

		return new PageInfo<MallGoodsSpecAttr>(page);
	}
	
	
}